package fr.uniscol.model;

import java.io.Serializable;
import java.util.List;

public class EtablissementModel implements Serializable {

	private long id = 0;
	
	private String uai = null;
	
	private String nom = null;	
			
	private String telephone = null;
	
	private String email = null;

	private Adresse adresse = null;
	
	private Academie academie = null;
	 
	private List<BaseAnneeScolaire> bases = null;
	
	public EtablissementModel(){
	}
	
	public EtablissementModel(long id){
		this.id = id;
	}
	
	public EtablissementModel(String uai, String nom){
		this.uai = uai;
		this.nom = nom;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getUai() {
		return uai;
	}

	public void setUai(String uai) {
		this.uai = uai;
	}

	public String getNom() {
		return nom;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	public Adresse getAdresse() {
		if(adresse == null){
			adresse = new Adresse();
		}
		return adresse;
	}

	public void setAdresse(Adresse adresse) {
		this.adresse = adresse;
	}

	public Academie getAcademie() {
		return academie;
	}

	public void setAcademie(Academie academie) {
		this.academie = academie;
	}

	public List<BaseAnneeScolaire> getBases() {
		return bases;
	}

	public void setBases(List<BaseAnneeScolaire> bases) {
		this.bases = bases;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 29 * hash + (int) (this.id ^ (this.id >>> 32));
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final EtablissementModel other = (EtablissementModel) obj;
        if (this.id != other.id) {
            return false;
        }
        return true;
    }
}
